<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>系统首页</title>
		<script type="text/javascript" src="../layui/layui.js"></script>
		<link rel="stylesheet" href="../layui/css/layui.css">
		<link rel="stylesheet" type="text/css" href="../css/backer/SysHomePage.css"/>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>
	</head>

	<body>
		<div class="Head-Notice">
			<span><i class="layui-icon layui-icon-reply-fill" style="font-size: 20px;"></i>公告</span>
		</div>
		<!--用户登录信息和快捷发布-->
		<div class="layui-row">
			<div class="layui-col-xs12 layui-col-sm12 layui-col-md7 layui-tables usercard" style="height: 300px;">
				<!--用户头像-->
	     		<img th:src="@{'../static/images/userimg/'+${session.user.picture}}" class="layui-circle layui-row-div-img" width="140px" height="140px">
	     		<div class="usercard-info">
	     			<span class="username"></span>
		     		<button class="layui-btn layui-btn-primary layui-btn-sm qdbutton" v="1">
		     			<i class="layui-icon layui-icon-edit"></i><span id="qdtext">签到</span>
		     		</button>
					<p style="color:#999999;">用户组&nbsp;:&nbsp;<span th:text="${session.user.role.roleName}"></span>&nbsp;长期有效</p>
		     		<button class="layui-btn layui-btn-primary layui-btn-sm phonelogin">手机登录</button>
		     		<button class="layui-btn layui-btn-primary layui-btn-sm qqlogin" style="margin-left: 20px;">QQ登录</button>
		     		<button class="layui-btn layui-btn-primary layui-btn-sm wechatlogin" style="margin-left: 20px;">微信登录</button>
	     		</div>
	     		<hr style="margin: 30px 20px 20px 20px;"/>

				<div style="margin-left: 50px;">欢迎来到荆州好房子用户中心！</div>
				<!--<div>11:</div><span style="margin-left: 10px" class="lastlogindate"></span>
				<br/>
	     		<div>22:</div><span style="margin-left: 10px" class="lastloginIP" th:text="${session.ip}"></span>-->
		    </div>
		    <div class="layui-col-xs12 layui-col-sm12 layui-col-md5 layui-tables" style="height: 300px;width: 50.2%;">
		     	<h2 style="margin:20px 0px 0px 40px;">快捷发布</h2>
		     	<hr style="margin: 10px 20px 50px 20px;"/>
		     	
		     	<div style="text-align: center;">
		     		<a href="http://localhost:8080/backer/houseForSale" >
			     		<div  class="cursor" style="display: inline-block;margin-left: 0px;text-align: center;">
				     		<img src="../images/backer/ershoufang.png" width="70px" height="70px"/>
				     		<p class="buyhousetitle">有房出售</p>
			     			<p class="buyhousecontext">24H不间断帮你卖房</p></p>
				     	</div>
			     	</a>
			     	<a href="http://localhost:8080/backer/houseRental">
			     	<div class="buyhousepic cursor" style="margin-left: 40px;">
			     		<img src="../images/backer/zufang.png" width="70px" height="70px"/>
			     		<p class="buyhousetitle">有房出租</p>
			     		<p class="buyhousecontext">轻松赚租金</p>
			     	</div>
			     	</a>
			     	<a href="http://localhost:8080/backer/buyHouse">
			     	<div class="buyhousepic cursor" style="margin-left: 40px;">
			     		<img src="../images/backer/zhaozhongjie.png" width="70px" height="70px"/>
			     		<p class="buyhousetitle">我想买个房子</p>
			     		<p class="buyhousecontext">提交求购房产需求</p>
			     	</div>
			     	</a>
			     	<a href="http://localhost:8080/backer/rentHouse">
			     	<div class="buyhousepic cursor">
			     		<img src="../images/backer/xiaoqufangjia.png" width="70px" height="70px"/>
			     		<p class="buyhousetitle">我想租个房子</p>
			     		<p class="buyhousecontext">提交你的需求</p>
		     		</div>
		     		</a>
		     	</div>
		    </div>
		</div>
		<!--信息统计和财务信息-->
		<div class="layui-row" style="margin-top: 300px;">
			<div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-tables usercard" style="height: 270px;">
				<h2 style="margin:20px 0px 0px 40px;">信息统计</h2>
		     	<hr style="margin: 10px 20px 10px 20px;"/>
		     	
		     	<div style="text-align: center;">
		     		<span class="quickmanage">快速管理&nbsp;:&nbsp;</span>
		     		<input placeholder=" 请输入标题关键词" class="quickmanage-input"/>
		     		<button onclick="location.href='http://localhost:8080/backer/sellInfo';" class="layui-btn layui-btn-primary layui-btn-sm searchbtn"><i class="layui-icon layui-icon-search"></i>搜索</button>
		     	</div>
		     	<div class="infosum" style="margin:0px auto;width: 100%;text-align: center;">
		     		<div>
		     			<p>7</p>
		     			<p class="lastp">已发布信息</p>
		     		</div>
		     		<div>
		     			<p>2</p>
		     			<p class="lastp">精选</p>
		     		</div>
		     		<div>
						<p>3</p>
		     			<p class="lastp">站内信</p>
		     		</div>
		     		<div>
		     			<p>1</p>
		     			<p class="lastp">待审</p>
		     		</div>
		     		<div>
		     			<p>8</p>
		     			<p class="lastp">收藏</p>
		     		</div>
		     	</div>
		    </div>
		    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-tables cwinfo" style="height: 270px;width: 50.1%;">
		     	<h2 style="margin:20px 0px 0px 40px;">财务信息</h2>
		     	<hr style="margin: 10px 20px 20px 20px;"/>
		     	<div style="width: 100%;">
		     		<div style="float: left;margin-left: 40px;">
		     			<button class="Recharge cursor" onclick="location.href='http://localhost:8080/backer/rechargeCenter;';">充值</button>
		     			<button class="Recharge2 cursor" onclick="location.href='http://localhost:8080/backer/rechargeCenter;';">明细</button>
		     		</div>
		     		
		     		<div style="float: right;margin-right: 40px;">
		     			<a href="http://localhost:8080/backer/rechargeCenter" style="color: #409EFF;">金币兑换</a>
		     		</div>
		     	</div>
	     		<div class="infosum infosum2">
		     		<div>
		     			<p class="usergold">100</p>
		     			<p class="lastp">金币余额</p>
		     		</div>
		     		<div style="margin-left:40px;margin-right: 30px;">
		     			<p class="userpoint">100</p>
		     			<p class="lastp">刷新积分</p>
		     		</div>
		     		<div>
		     			<p class="userbalance">0.00</p>
		     			<p class="lastp">可提现余额</p>
		     		</div>
		     	</div>
		     	
		    </div>
		</div>
		
		<div class="layui-row buttomtemplate" style="margin-top: 270px;">
			<div class="layui-col-xs4 layui-col-sm4 layui-col-md4 templateshadow cursor">
				<img src="../images/backer/h1.png" />
				<p class="fontbold">信息置顶</p>
				<p class="twop">推广全城/火箭，成交！</p>
			</div>
			<div class="layui-col-xs4 layui-col-sm4 layui-col-md4 templateshadow cursor">
				<img src="../images/backer/h2.png" />
				<p class="fontbold">VIP会员</p>
				<p class="twop">专享会员福利</p>
			</div>
			<div class="layui-col-xs4 layui-col-sm4 layui-col-md4 templateshadow cursor">
				<img src="../images/backer/h3.png" />
				<p class="fontbold">经纪人端口（中介人）</p>
				<p class="twop">千条信息端口/一键刷新/VIP网店/经纪人工作台</p>
			</div>
		</div>
		<div style="width: 25px;height:25px;"></div>
	</body>
<script th:inline="javascript">
	console.log(/*[[${session.qd}]]*/ {});
	$.each(/*[[${session.qd}]]*/ {},function (i,d){
		if((/*[[${session.user.uid}]]*/  0)==d){
			$("#qdtext").text("已签到");
			$(".qdbutton").css("background-color","#F4F4F5");
			$(".qdbutton").css("color","#9D9D9D");
			$(".qdbutton").attr("v","2");
			return;
		}
	});
	$(".qdbutton").click(function() {
		if ($(".qdbutton").attr("v")=="1") {
			$(".qdbutton").css("background-color", "#F4F4F5");
			$(".qdbutton").css("color", "#9D9D9D");
			$.ajax({
				url: 'http://localhost:8080/backer/modifygold',
				type: 'post',
				success: function (data) {
					if (data) {
						$(".qdbutton").attr("v","0");
						$("#qdtext").text("已签到");
						alert("签到成功！");
					}
				}
			})
		}
	})



	$(function(){
		$.ajax({
			url:"http://localhost:8080/backer/syspage",
			type:"post",
			dataType:"json",
			success:function(data){
				$(".username").text(data.linkman);
				$(".lastlogindate").text(new Date().getFullYear()+"-"+new Date().getMonth()+"-"+new Date().getDate());
				$(".userbalance").text(data.balance);
				$(".userpoint").text(data.integral);
				$(".usergold").text(data.gold);
			}
		});
	});
	$(".layui-tables,.templateshadow").hover(function(){
		$(this).addClass("body-row-shadow");
	},function(){
		$(this).removeClass("body-row-shadow");
	})






</script>
</html>